<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        div.big{
            width: 500px;height: 50px;background-color: dodgerblue;
            color:white
        }
    </style>
    <meta charset="UTF-8">
    <title>Title</title>
<script type="text/javascript">
function btnClick() {
    var tmp = document.getElementById("foo");
    var k = document.getElementById("hehe");
    var big  = document.getElementById("big")

    var dirty  = [/靠/ig,/tmd/ig]
    var check_dirty = k.value
    dirty.forEach(element => {
        check_dirty=check_dirty.replace(element,"*")
    });
    big.innerHTML = check_dirty
    

    alert(tmp.textContent)
    alert(k.value)
}
</script>

</head>
<body>

</body>
<input type="text" id="hehe" >
<p id="foo">211111103</p>
<button onclick="btnClick()">click me</button>
<div class="big" id="big"></div>
</html>